package com.ctsi.security.event.role;

import com.ctsi.commons.event.AbstractObserver;
import com.ctsi.commons.event.BaseEvent;
import com.ctsi.organise.common.model.UserLogin;
import com.ctsi.security.manager.impl.DepartAdminFetchObjIds;
import com.ctsi.security.manager.impl.DishiAdminFetchObjIds;
import com.ctsi.security.manager.impl.OrganFetchObjIds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class RemoveUserloginDoTypeIds extends AbstractObserver {
   private  final Logger logger=LoggerFactory.getLogger(RemoveUserloginDoTypeIds.class);
	/**
	 *
	 */
	private static final long serialVersionUID = 2836868430237460689L;

	@Override
	public void onEvent(Object[] args) {
		BaseEvent event=(BaseEvent) args[0];
		UserLogin userLogin=(UserLogin) event.getSource();
		logger.info("清除登录用户缓存的数据对象ID");
		OrganFetchObjIds.removeCache(userLogin.getId());
		DepartAdminFetchObjIds.removeCache(userLogin.getId());
		DishiAdminFetchObjIds.removeCache(userLogin.getId());
	}

}
